<?php

namespace App\Http\Controllers\Admin\Sponsor;

use App\Services\Admin\Sponsor\UserIntegralService;
use Exception;
use Illuminate\Http\JsonResponse;

class UserIntegralController extends BaseSponsorController
{
    protected UserIntegralService $userIntegralService;

    /**
     * @throws Exception
     */
    public function __construct()
    {
        parent::__construct();
        $this->userIntegralService = $this->loadService('Admin\Sponsor\UserIntegralService');
    }

    /**
     * 发放积分记录列表
     * @return JsonResponse
     * @throws Exception
     */
    public function list(): JsonResponse
    {
        $list = $this->userIntegralService->list($this->params);

        return outputJsonResult($list);
    }
}
